import { RouteRecordRaw } from 'vue-router'
import productRouter from './modules/product'
import settingRouter from './modules/setting'
import systemRouter from './modules/system'

// 主页面路由
const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/admin/home'
  },
  {
    path: '/admin',
    component: () => import('@/layout/index.vue'),
    redirect: '/admin/home',
    meta: {
      required: true
    },
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/home/index.vue')
      },
      productRouter,
      settingRouter,
      systemRouter
    ]
  },
  {
    path: '/user',
    name: 'user',
    redirect: '/user/login',
    component: () => import('@/layout/blankLayout.vue'),
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import('@/views/login/index.vue')
      }
    ]
  }
]

// 非主页面路由

export default routes
